/* 
 * File:   disaster.hpp
 * Author: dolphinigle
 *
 * Created on March 16, 2011, 11:33 AM
 */

#ifndef DISASTER_HPP
#define	DISASTER_HPP

#include <fstream>
#include "gameinterface.hpp"
#include "view.hpp"

class Disaster {
public:

  // normal game constructor
  Disaster(GameInterface* game);

  // load game constructor
  Disaster(GameInterface* game, std::ifstream& is);

  virtual void save(std::ofstream& os);
  
  virtual ~Disaster();

  void showData();

  void advanceDay();
  void advanceTime();

  void showInfo(int disaster_id);

  void addProtection(int day_count);

private:

  static const int kDisasterCount;
  static const int kDisasterChance ;
  static const int kDisasterWeight[];
  static const bool kDisasterActive[];
  static const std::string kDisasterName[];
  static const std::string kDisasterDescription[];

  GameInterface* game_;

  void updateDisaster();
  void performDisaster(int disaster_id);

  int itbpc_protection_duration_;

};

#endif	/* DISASTER_HPP */

